package com.sharemarking.wa.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sharemarking.wa.common.entity.OrgVerify;
import com.sharemarking.wa.platform.dto.wasteType.WasteTypeListDto;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author dxy
 */
@Repository
public interface OrgVerifyMapper extends BaseMapper<OrgVerify> {
    @Select("SELECT a.exam_state AS examState,reject_reason FROM wa_org_verify a LEFT JOIN sys_org_member b ON a.org_id = b.org_id\n" +
            "WHERE b.member_id = #{memberId}")
    OrgVerify isOrgVerify(Integer memberId);

    @Select("SELECT waste_type_id, waste_type_name AS wasteTypeName FROM wa_org_waste_type WHERE org_id = #{orgId}")
    List<WasteTypeListDto> getOrgWasteTypeList(Integer orgId);

}
